{include file="base/header"}
        <div class="layui-card">
            <div class="layui-card-body">
                <form class="layui-form" action="">
                    <div class="layui-form-item">
                        <div class="layui-form-item layui-inline">
                            <label class="layui-form-label">购买人信息</label>
                            <div class="layui-input-inline">
                                <input type="text" name="umsg" placeholder="请输入昵称，姓名，手机号" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item layui-inline">
                            <label class="layui-form-label">返佣人信息</label>
                            <div class="layui-input-inline">
                                <input type="text" name="fmsg" placeholder="请输入昵称，姓名，手机号" class="layui-input">
                            </div>
                        </div>
               
                        <div class="layui-form-item layui-inline">
                            <button class="pear-btn pear-btn-md pear-btn-primary" lay-submit lay-filter="user-query">
                                <i class="layui-icon layui-icon-search"></i>
                                查询
                            </button>
                            <button type="reset" class="pear-btn pear-btn-md">
                                <i class="layui-icon layui-icon-refresh"></i>
                                重置
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        
        <div class="layui-card">
            <div class="layui-card-body">
                <table id="tableId" lay-filter="user-table"></table>
            </div>
        </div>
        
        <script type="text/html" id="user-usermsg">
            <img src="{{d.umsg.head_img}}" class="layui-nav-img">
            <span>{{d.umsg.nickname}}
            </span>
            {{#if (d.umsg.mobile ) { }}
                <span>| {{d.umsg.mobile}}</span>
            {{# } }}
        </script>
        <script type="text/html" id="user-fusermsg">
            {{#if (d.yprice_userid ) { }}
            <img src="{{d.fmsg.head_img}}" class="layui-nav-img">
            <span>{{d.fmsg.nickname}}</span>
                {{#if (d.fmsg.mobile ) { }}
                    <span>| {{d.fmsg.mobile}}</span>
                {{# } }}

            {{# }else{ }}
            -
            {{# } }}
        </script>
        <script type="text/html" id="user-yprice">
            <span>{{d.yprice}}</span>
        </script>

        <script>
			layui.use(['table', 'form', 'jquery','common'], function() {
				let table = layui.table;
				let form = layui.form;
				let $ = layui.jquery;
				let common = layui.common;
                let cols = [
                    [{
                        title: '订单单号',
                        field: 'sn',
                        align: 'left',
                        width: 150
                    },
                    {
                        title: '套餐名称',
                        field: 'tc_name',
                        align: 'center',
                       
                    },
                    {
                        title: '套餐天数',
                        field: 'tc_day_num',
                        align: 'center',
                        width:150
                    },
                    {
                        title: '套餐金额(￥)',
                        field: 'tc_price',
                        align: 'center',
                        width: 150
                    },
                    
                    {
                            title: '购买用户',
                            field: 'nickname',
                            align: 'center',
                            templet: '#user-usermsg',
                            width: 250,
                        },
                    {
                        title: '返佣用户',
                        field: 'reaname',
                        align: 'center',
                        templet: '#user-fusermsg',
                        width: 250,
                    },
                    {
                        title: '返佣金额(￥)',
                        field: 'yprice',
                        align: 'center',
                        templet: '#user-yprice',
                        width: 200,
                    },
                    {
                        title: '支付时间',
                        field: 'paytime',
                        align: 'center',
                        width: 250
                    },
                    ]
                ];
                table.render({
                    elem: '#tableId',
                    url: "{:url('basic/usertclst')}",
                    page: true,
                    cols: cols,
                    skin: 'line',
                    toolbar: '#user-toolbar',
                    defaultToolbar: [{
                        title: '刷新',
                        layEvent: 'refresh',
                        icon: 'layui-icon-refresh',
                    }, 'filter',  'exports']
                });
                table.on('toolbar(user-table)', function (obj) {
                    if (obj.event === 'refresh') {
					    window.refresh();
                    }
                });
                window.refresh = function(param) {
					table.reload('tableId');
				}

                form.on('submit(user-query)', function (data) {
                    table.reload('tableId', {
                        page: {curr: 1 },
                        where: data.field
                    })
                    return false;
                });

			})
		</script>
        </script>
{include file="base/footer"}